#pragma once

// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the FTLIBOPENCL_EXPORTS
// symbol defined on the command line. This symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// FTLIBOPENCL_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef FTLIBOPENCL_EXPORTS
#define FTLIBOPENCL_API __declspec(dllexport)
#else
#define FTLIBOPENCL_API __declspec(dllimport)
#endif

//// This class is exported from the FTLibOpenCL.dll
//class FTLIBOPENCL_API CFTLibOpenCL {
//public:
//	CFTLibOpenCL(void);
//	// TODO: add your methods here.
//};
//
//extern FTLIBOPENCL_API int nFTLibOpenCL;
//
//FTLIBOPENCL_API int fnFTLibOpenCL(void);

#include "..\FTLib\IFourierTransformStructures.h"

bool FTLIBOPENCL_API clFFT_CheckAvailability();

/// <summary>	Get the clFFT version string. </summary>
///
/// <param name="sz">	  	[out] A pointer to the buffer that receives the string. </param>
/// <param name="pLength">	[in,out] On input, specifies the size of the buffer, in CHARs. On output, the number of CHARs copied to the destination buffer, not including the terminating null character. </param>
///
/// <returns>	True if the buffer was long enough or if it was NULL, false otherwise. </returns>
bool FTLIBOPENCL_API clFft_GetVersionString(char* sz, size_t* pLength);

struct OPENCLFTPLANHANDLE
{
private:
	size_t opaque1;
	intptr_t opaque2;
	intptr_t opaque3;
	intptr_t opaque4;
	intptr_t opaque5;
	uint16_t opaque6;
};

OPENCLFTPLANHANDLE FTLIBOPENCL_API clFFT_CreatePlan_2dRealToComplexPackedFftw(uint32_t width, uint32_t height, float scaleFactor);
void FTLIBOPENCL_API clFFT_2d_RealToComplexPackedFftw(const OPENCLFTPLANHANDLE& plan, const FTLib::FourierTransfRealInputData2d& input, const FTLib::FourierTransfComplexOutput2d& output);

OPENCLFTPLANHANDLE FTLIBOPENCL_API clFFT_CreatePlan_2dRealToComplex(uint32_t width, uint32_t height);
void FTLIBOPENCL_API clFFT_2d_RealToComplex(const OPENCLFTPLANHANDLE& plan, const FTLib::FourierTransfRealInputData2d& input, const FTLib::FourierTransfComplexOutput2d& output);

OPENCLFTPLANHANDLE FTLIBOPENCL_API clFFT_CreatePlan_2dComplexToComplex(uint32_t width, uint32_t height, float scaleFactor);
void FTLIBOPENCL_API clFFT_2d_ComplexToComplex(const OPENCLFTPLANHANDLE& plan, bool forward, const FTLib::FourierTransfComplexInput2d& input, const FTLib::FourierTransfComplexOutput2d& output);

OPENCLFTPLANHANDLE FTLIBOPENCL_API clFFT_CreatePlan_2dComplexHermetianToReal(uint32_t width, uint32_t height, float scaleFactor);
void FTLIBOPENCL_API clFFT_2d_ComplexHermetianToReal(const OPENCLFTPLANHANDLE& plan, const FTLib::FourierTransfComplexInput2d& input, const FTLib::FourierTransfRealOutputData2d& output);

void FTLIBOPENCL_API clFFT_DeletePlan(OPENCLFTPLANHANDLE& handle);

void FTLIBOPENCL_API clFFT_TearDown();


